home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / tex / tex31 / inputs.lzh / lfonts.tex < prev    next >
Text File  |  1990-04-12  |  39KB  |  885 lines

  1. % File LFONTS - Version of 21 November 1989
  2. %
  3. % This version of LFONTS.TEX is for the CMR fonts.  It was converted
  4. % from the AMR version by David Fuchs on 18 December 1985.
  5. % And corrected on 11 Nov 1986 by Leslie Lamport.  
  6. % Last vestige of AMR fonts removed 3 Mar 89 by Leslie Lamport.
  7.  
  8. % This file needs to be customized for the fonts available at a particular
  9. % site.  There are three places where changes need to be made.  They
  10. % can be found by searching this file for the string  FONT-CUSTOMIZING.
  11. %
  12. % FONT CONVENTIONS
  13. %
  14. % A TYPESTYLE COMMAND is something like \it that defines a type style.
  15. % Each style command \xx is defined to be \protect\pxx, where 
  16. % \pxx is defined to choose the correct font for the current size.
  17. % This allows style commands to appear in 'unsafe' arguments where
  18. % protection is required.
  19. %
  20. % A SIZE COMMAND is something like \normalsize that defines a type size.
  21. % It is defined by the document style.  However, \normalsize is handled
  22. % somewhat differently because it is called so often--e.g., on every
  23. % page by the output routine.  The document style defines \@normalsize
  24. % instead of \normalsize.
  25. % A ONE-SIZE typestyle is one that exists only in the \normalsize size.
  26. %
  27. % A FONT-SIZE COMMAND is one that defines \textfont, \scriptfont and 
  28. % \scriptscriptfont for the font families corresponding to preloaded fonts,
  29. % as well as the typestyle commands for the preloaded fonts.  Each
  30. % font-size command has an associated @fontsize command, having the same
  31. % name except for an '@' at the front.   All font-size commands are defined 
  32. % in LFONTS.  The naming convention is that a fifteenpt font has a font-size
  33. % name \xvpt, and so on.
  34. %
  35. % Each size command \SIZE executes the command
  36. %             \@setsize\SIZE{BASELINESKIP}\FONTSIZE\@FONTSIZE
  37. % which does the following.
  38. %   0. Executes \@nomath\SIZE to issue warning if in math mode.
  39. %   1. \let \@currsize = \SIZE  
  40. %   2. Sets \strutbox to a strut of height .7 * BASELINESKIP and
  41. %      depth .3 * BASELINESKIP
  42. %
  43. %       Note: Charles Karney observed that step 2 is useless, since the
  44. %       \FONTSIZE command executed in step 4 resets \strutbox using
  45. %       the actual baselineskip, which is \baselinestretch * BASELINESKIP.
  46. %       Some day, this step may get removed.  (Note made 28 Feb 89)
  47. %
  48. %   3. Sets \baselineskip to \baselinestretch * BASELINESKIP 
  49. %      and 
  50. %   4. Calls \FONTSIZE 
  51. %   5. Executes the \@FONTSIZE command.
  52. % It should then define all the typestyle commands not defined by the font-size
  53. % command, except for the one-size type styles. A typestyle command for which
  54. % the corresponding font exists but is not preloaded is defined to expand to a
  55. % \@getfont command.  A typestyle whose font does not exist is defined to 
  56. % expand to a \@subfont command.
  57. %
  58. % A one-size typestyle whose font is not preloaded is defined to expand to
  59. % a \@onesizefont command.
  60. %
  61. % \em is defined to be \it inside an unslanted style and \rm inside a
  62. % slanted style.  An \em command in a section title will produce a \pem
  63. % command in the table of contents.
  64. %
  65.  
  66. \def\em{\protect\pem{}}
  67. \def\pem{\ifdim \fontdimen\@ne\font >\z@ \rm \else \it \fi}
  68.  
  69. \def\normalsize{\ifx\@currsize\normalsize \rm \else \@normalsize\fi}
  70.  
  71. % \load{SIZE}{STYLE} : Solves anomaly of loaded-on-demand font
  72. %    used for first time in math mode.  Give this command outside math
  73. %    mode, before formula using it for first time.
  74. \def\load#1#2{\let\@tempa\@currsize \let\@currsize\relax #1#2\@tempa}
  75.  
  76. % \newfont{\CMD}{FONT} defines \CMD to be the font FONT.
  77. %    It is equivalent to \font \CMD = FONT
  78. % \symbol{NUM} == \char NUM
  79.  
  80. \def\newfont#1#2{\@ifdefinable #1{\font #1=#2\relax}}
  81. \def\symbol#1{\char #1\relax}
  82.  
  83.  
  84.  
  85. % \@getfont \STYLE \FAM \@FONTSIZE{LOADING.INFO}
  86. %   \STYLE       = style command
  87. %   \FAM         = a control sequence defined by \newfam\FAM
  88. %   \@FONTSIZE   = the @fontsize command for the current size. 
  89. %   LOADING.INFO = information needed to load the font--e.g., 
  90. %                  cmtti10 \magstep 2
  91. %   Does the following, where \FONTNAME denotes a new unique, untypeable
  92. %   font name:
  93. %    1. Executes  \font \FONTNAME = LOADING.INFO 
  94. %    2. Appends '\textfont FAM \FONTNAME \def\STYLE{\fam \FAM \FONTNAME}' 
  95. %       to the definition of \@FONTSIZE.
  96. %    3. Executes \@FONTSIZE \STYLE.
  97. %
  98. % \@nohyphens\STYLE\@FONTSIZE
  99. %   Used right after \@getfont to set \hyphenchar of the new font to -1,
  100. %   thereby prohibiting hyphenation.  It is used with \tt fonts.
  101. %   (\@nohyphens was added on 12/18/85)
  102. %
  103. % \@subfont \STYLE \REPSTYLE 
  104. %   \STYLE, \REPSTYLE = type style commands.
  105. %   Types warning message and defines uses \REPSTYLE.
  106. %
  107. % \@onesizefont \STYLE {LOADING.INFO}
  108. %   Defines \STYLE to be a typestyle that exists only for the \normalsize
  109. %   size.  It produces the font specified by LOADING.INFO
  110. %
  111. % \@addfontinfo\@FONTSIZE{DEFS}
  112. %    Expands DEFS and adds to the definition of \@FONTSIZE. Items that should 
  113. %    not be expanded should be protected with \@prtct---except no protection
  114. %    is needed for '\def\foo', only for the contents of the definition.
  115. %
  116. % \@nomath\CS : Types a warning '\CS used in math mode' if encountered
  117. %    in math mode.
  118.  
  119. % Remove \outer from definition of \newfam
  120. \def\newfam{\alloc@8\fam\chardef\sixt@@n}
  121.  
  122. \def\@setsize#1#2#3#4{\@nomath#1\let\@currsize#1\baselineskip
  123.    #2\setbox\strutbox\hbox{\vrule height.7\baselineskip
  124.       depth.3\baselineskip width\z@}\baselineskip\baselinestretch\baselineskip
  125.    \normalbaselineskip\baselineskip#3#4}
  126.  
  127. \newif\if@bold
  128.  
  129. \let\@prtct=\relax
  130.  
  131. \def\@addfontinfo#1#2{{\def\@prtct{\noexpand\@prtct\noexpand}\def\def{\noexpand
  132.     \def\noexpand}\xdef#1{#1#2}}}
  133.  
  134. \def\@getfont#1#2#3#4{\@ifundefined{\string #1\string #3}{\global\expandafter
  135.     \font \csname \string #1\string #3\endcsname #4\relax 
  136.      \@addfontinfo#3{\textfont #2\csname \string #1\string #3\endcsname 
  137.      \scriptfont #2\csname \string #1\string #3\endcsname 
  138.      \scriptscriptfont #2\csname \string #1\string #3\endcsname 
  139.      \def#1{\fam #2\csname\string #1\string #3\endcsname}}}{}#3#1}
  140.  
  141. \def\@nohyphens#1#2{\global\expandafter \hyphenchar\csname 
  142.    \string #1\string #2\endcsname \m@ne}
  143.  
  144. \def\@subfont#1#2{\@warning{No \string#1\space typeface in 
  145.         this size, using \string#2}#2}
  146.  
  147. \def\@onesizefont#1#2{\expandafter\newfam\csname fm\string#1\endcsname
  148.   \global\expandafter\font\csname ft\string#1\endcsname #2\relax
  149.   \gdef#1{\ifx \@currsize\normalsize \@ftfam#1\else
  150.   \@warning{Typeface \string#1\space available only in 
  151.   \string\normalsize, using \string\rm}\gdef #1{\ifx \@currsize\normalsize 
  152.   \textfont\@fontfam#1 \scriptfont\@fontfam#1 \scriptscriptfont
  153.   \@fontfam#1\@ftfam#1\else \rm\fi}#1\fi}#1}
  154.  
  155. \def\@ftfam#1{\fam\csname fm\string#1\endcsname\csname ft\string#1\endcsname}
  156.  
  157. \def\@nomath#1{\ifmmode \@warning{\string#1\space in math mode.}\fi}
  158. \def\@nomathbold{\ifmmode \@warning{\string\mathbold\space in math mode.}\fi}
  159.  
  160. % The following definitions save token space.  E.g., using \@height 
  161. % instead of height saves 5 tokens at the cost in time of one macro 
  162. % expansion.
  163.  
  164. \def\@height{height}
  165. \def\@depth{depth}
  166. \def\@width{width}
  167.  
  168. \def\@magscale#1{ scaled \magstep #1}
  169. \def\@halfmag{ scaled \magstephalf}
  170. \def\@ptscale#1{ scaled #100}
  171.  
  172.  
  173. %% FONT-CUSTOMIZING:  The following \font commands define the
  174. %% preloaded LaTeX fonts.  Font names should be changed to cause
  175. %% different fonts to be loaded in place of these particular AMR fonts.
  176. %% \font commands should be added or deleted to change which fonts
  177. %% are preloaded.
  178.  
  179. % five point
  180.  \font\fivrm  = cmr5               % roman
  181.  \font\fivmi  = cmmi5              % math italic
  182.     \skewchar\fivmi ='177          %  for placement of accents
  183. %\font\fivmib = cmmib10  \@ptscale5 % bold math italic
  184.  \font\fivsy  = cmsy5              % math symbols
  185.     \skewchar\fivsy ='60           %   for placement of math accents
  186. %\font\fivsyb = cmbsy10 \@ptscale5 % bold math symbols
  187. %\font\fivit  = cmti7   scaled 714 % text italic
  188. %\font\fivsl  = cmsl10  \@ptscale5 % slanted
  189. %\font\fivbf  = cmbx7   scaled 714 % extended bold 
  190. %\font\fivbfs = cmbxsl10\@ptscale5 % extended bold slanted
  191. %\font\fivtt  = cmtt10  \@ptscale5 % typewriter
  192. %\font\fivtti = cmitt10 \@ptscale5 % ital